<style type="text/css">
#search-block {
	padding: 20px;
}

.lesson:not(:first-child){
	margin-top: 20px;
}

.lesson-header {
	font-size: 16px;
}

.lesson-des {
	font-size: 12px;
}

.lesson-user {
	color: blue;
}
</style>
<div id="search-block">
	<form id="search-form" method="post" action="<?php echo $this->createUrl('lesson/search');?>">
		ค้นหาจากชื่อบทเรียน <input type="text" name="search[lesson_name]" value="<?php echo $search['lesson_name'];?>" /><br />
		ค้นหาจากผู้สร้าง <input type="text" name="search[user_name]" value="<?php echo $search['user_name'];?>" /><br />
		<input type="submit" value="ค้นหา" /><br />
	</form>
	<?php foreach($lessons as $key => $lesson){?>
	<div class="lesson">
		<div class="lesson-header">
			<a href="<?php echo $this->createUrl('lesson/'.$lesson->lesson_id);?>"><?php echo $lesson->lesson_name;?></a>
		</div>
		<div class="lesson-des">
			<?php echo $lesson->lesson_detail;?>
		</div>
		<div class="lesson-user">owner : <?php echo $lesson->user->user_name;?></div>
	</div>
	<?php }?>
</div>
<script type="text/javascript">
$(function(){
	$('#search-form').submit(function(event){
		event.preventDefault();
		var url = $(this).attr('action');
		var data = {};
		$(this).find('*[name]').each(function(){
			data[$(this).attr('name')] = $(this).val();
		});
		$('#left-content').load(url,data,function(){
			// statement
		});
	});
});
</script>